package com.why.remote;

import com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBaseIterators;
import com.why.dto.NhDto;
import com.why.pojo.Account;
import com.why.pojo.IcCard;
import com.why.pojo.OldMan;
import com.why.pojo.RunningWater;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;

public interface AccountRemote {

    //注册用户调用接口
    @RequestMapping("/register")
    NhDto<String> register(@RequestBody Account account);

    //用户名验证唯一
    @RequestMapping("/loginNameSole")
    NhDto<Account> loginNameSole(@RequestParam("loginname") String loginname);

    //登录
    @RequestMapping("/login")
    NhDto<String> login(@RequestParam("loginname") String loginname,@RequestParam("password") String password);

    //发送验证码
    @RequestMapping("/logon/send")
    NhDto<HashMap<String, Object>> send(@RequestParam("phone") String phone);

    //修改密码
    @RequestMapping("/logon/change")
    NhDto<String> change(@RequestBody Account account);

    //查询用户信息
    @RequestMapping("/logon/queryUserInfo")
    NhDto<Account> queryUserInfo(@RequestParam("token") String token);

    //查询老人信息
    @RequestMapping("/logon/queryOldMan")
    NhDto<List<OldMan>> queryOldMan(@RequestParam("token") String token);

    //充值
    @RequestMapping("topUp")
    NhDto<Boolean> topUp(@RequestBody IcCard icCard);

    //账单查询
    @RequestMapping("/queryRunningWater")
    NhDto<List<RunningWater>> queryRunningWater(@RequestParam("odlManID") Integer odlManID,
                                                @RequestParam("consumptionTime") String consumptionTime);
}
